<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        span {
            color: white;
        }
        .content-center {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .header {
            background-color: #7dbcea;
            height: 50px;
        }
        .content {
            background-color: #108ee9;
            height: 100px;
        }
        .footer {
            background-color: #7dbcea;
            height: 50px;
        }
        .txt-center {
            background-color: red;
            width: 200px;
            height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
    </style>
</head>
<body>
<div class="header content-center"><span>Header</span></div>
<div class="content content-center"><span>Content</span></div>
<div class="footer content-center"><span>Footer</span></div>

<div class="txt-center">文字居中</div>
</body>
</html>